<template>
	<view class="law-info">
		<view class="law-info_content">
			<u-parse :content="content"></u-parse>
		</view>
	</view>
</template>

<script setup>
	import {ref} from 'vue';
	import {
		userInfoStore
	} from '/stores/index.js'
	import {
		onLoad
	} from "@dcloudio/uni-app";
	const content = ref('')
	const store = userInfoStore();
	const getAgreement = (query) => {
		content.value = ""
		if(!query.id) return false
		const item = store.loginAgreementList.find(i => i.id === query.id);
		if(item){
			content.value = item.agreementContent
		}
	}
	onLoad((option) => {
		const query = {}
		query.id = option.id
		if(option.contractId ){
			query.contractId = option.contractId
		}
		const title = option.title
		if(title){
			uni.setNavigationBarTitle({
			  title: title
			})
		}
		getAgreement(query)
	})
	
</script>
<style lang="scss">
	page {
		background: #F1F5F5;
	}
</style>
<style lang="scss" scoped>
	.law-info{
		background-color: #FFFFFF;
		&_content{
			padding: 20rpx;
		}
		
	}
</style>
